package com.cloud.base.proxy;

import com.cloud.base.proxy.impl.OrderServiceImpl;

public class JdkApplication {
    public static void main(String[] args) {
        //产生代理类对象.class  在当前目录下
        System.getProperties().put("sun.misc.ProxyGenerator.saveGeneratedFiles", "true");
        JdkInvocationHandler jdkInvocationHandler = new JdkInvocationHandler(new OrderServiceImpl());
        OrderService orderService = jdkInvocationHandler.getProxy();
        String result = orderService.addOrder("hty-jdk");
        System.out.println(result);
    }
}